<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var fn = function (f) {
            console.log(typeof f);
            var f = 2;

            function f() {

            }
            console.log(typeof f);
        }
        fn(1);
        var arr = ["q", "b", "c"];
        console.log(arr.slice());
        console.log(arr);

        function superFn() {
            var x = 0;
            return function () {
                x++;
                console.log(x);
            }
        }
        var s1 = superFn();
        var s2 = superFn();
        s1();
        s1();
        s1();
        s2();
        var oNum = {
            a: 1,
            b: 2
        };

        function demo(num) {
            num.c = 100;
        }
        demo(oNum);
        console.log(oNum);

        var Abc = function(){
   this.num = 1
  }
  Abc.prototype.exam = function(){
      return this.num++;
  }
  var abc = new Abc();
  console.log(abc.exam())

  function getCar() {
    this.type ='大众';
}
function myCar() {getCar.call(this)};
var car = new myCar();
console.log(car.type)

num = 10;
console.log(window.num)

// (function(){var a=b=5})();

var m = {x:1,y:2};
n = m;
n = {x:100,y:200};
console.log(m.x,n.x)

function fn(){
          console.log(a);
          console.log(foo());
          var a=1;
          function foo(){
            return 2;
          }
       } 
       fn();


       var b =[];
if(b[0]){   
   console.log(b==true);
}else{
   console.log("wut");
}

var f=function g(){return 23};
 console.log(typeof g())
    </script>
</body>

</html>